package com.it.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.it.entity.dispatch.AiClaimDispatch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 查勘调度表（报案受理后生成的查勘任务调度信息） Mapper 接口
 * </p>
 *
 * @author lutao
 * @since 2025年09月19日
 */
@Mapper
public interface AiClaimDispatchMapper extends BaseMapper<AiClaimDispatch> {

    List<AiClaimDispatch> list(String reportId, String surveyWorkNo, Integer dispatchStatus);

    List<AiClaimDispatch> undispatchList();

    @Update("update ai_claim_dispatch set dispatch_status = #{dispatchStatus} where report_id = #{reportNo} and surveyor_work_no = #{surveyWorkNo}")
    void update(String reportNo, String surveyWorkNo,Integer dispatchStatus);

    //根据报案号查询所有调度记录
    @Select("select * from ai_claim_dispatch where report_id = #{reportNo}")
    List<AiClaimDispatch> selectByReportNo(String reportNo);
}
